        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>ContactListener abstract class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="ContactListener">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/ContactListener.html">ContactListener</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>ContactListener</strong>
          abstract class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
abstract class ContactListener {
 /**
  * Called when two fixtures begin to touch.
  */
 void beginContact(Contact contact);

 /**
  * Called when two fixtures cease to touch.
  */
 void endContact(Contact contact);

 /**
  * This is called after a contact is updated. This allows you to inspect a
  * contact before it goes to the solver. If you are careful, you can modify 
  * the contact manifold (e.g. disable contact).
  * A copy of the old manifold is provided so that you can detect changes.
  * Note: this is called only for awake bodies.
  * Note: this is called even when the number of contact points is zero.
  * Note: this is not called for sensors.
  * Note: if you set the number of contact points to zero, you will not
  * get an EndContact callback. However, you may get a BeginContact callback
  * the next step.
  * Note: the oldManifold parameter is pooled, so it will be the same object
  * for every callback for each thread.
  */
 void preSolve(Contact contact, Manifold oldManifold);

 /**
  * This lets you inspect a contact after the solver is finished. This is
  * useful for inspecting impulses.
  * Note: the contact manifold does not include time of impact impulses,
  * which can be arbitrarily large if the sub-step is small. Hence the impulse
  * is provided explicitly in a separate data structure.
  * Note: this is only called for contacts that are touching, solid, and awake.
  */
  void postSolve(Contact contact, ContactImpulse impulse);
}
</pre>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="beginContact">
abstract void <strong>beginContact</strong>(<a href="../box2d/Contact.html">Contact</a> contact) <a class="anchor-link" href="#beginContact"
              title="Permalink to ContactListener.beginContact">#</a></h4>
<div class="doc">
<p>Called when two fixtures begin to touch.</p>
</div>
</div>
<div class="method"><h4 id="endContact">
abstract void <strong>endContact</strong>(<a href="../box2d/Contact.html">Contact</a> contact) <a class="anchor-link" href="#endContact"
              title="Permalink to ContactListener.endContact">#</a></h4>
<div class="doc">
<p>Called when two fixtures cease to touch.</p>
</div>
</div>
<div class="method"><h4 id="postSolve">
abstract void <strong>postSolve</strong>(<a href="../box2d/Contact.html">Contact</a> contact, <a href="../box2d/ContactImpulse.html">ContactImpulse</a> impulse) <a class="anchor-link" href="#postSolve"
              title="Permalink to ContactListener.postSolve">#</a></h4>
<div class="doc">
<p>This lets you inspect a contact after the solver is finished. This is
useful for inspecting impulses.
Note: the contact manifold does not include time of impact impulses,
which can be arbitrarily large if the sub-step is small. Hence the impulse
is provided explicitly in a separate data structure.
Note: this is only called for contacts that are touching, solid, and awake.</p>
</div>
</div>
<div class="method"><h4 id="preSolve">
abstract void <strong>preSolve</strong>(<a href="../box2d/Contact.html">Contact</a> contact, <a href="../box2d/Manifold.html">Manifold</a> oldManifold) <a class="anchor-link" href="#preSolve"
              title="Permalink to ContactListener.preSolve">#</a></h4>
<div class="doc">
<p>This is called after a contact is updated. This allows you to inspect a
contact before it goes to the solver. If you are careful, you can modify 
the contact manifold (e.g. disable contact).
A copy of the old manifold is provided so that you can detect changes.
Note: this is called only for awake bodies.
Note: this is called even when the number of contact points is zero.
Note: this is not called for sensors.
Note: if you set the number of contact points to zero, you will not
get an EndContact callback. However, you may get a BeginContact callback
the next step.
Note: the oldManifold parameter is pooled, so it will be the same object
for every callback for each thread.</p>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
